package com.conan.spring5.service;

import com.conan.spring5.dao.BookDAO;
import com.conan.spring5.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @version 加油！！！
 * @Description
 * @Author 谷藤新一GYC
 * @Date 2022/10/22 - 10:39
 */
@Service(value = "bookService")
public class BookServiceImpl implements BookService{
    //注入dao
    @Autowired
    private BookDAO bookDAO;


    @Override
    public void addUser(User user){
        bookDAO.addUser(user);
    }

    @Override
    public void updateUser(String pwd,User user) {
        bookDAO.updateUser(pwd,user);
    }

    @Override
    public void deleteUser(Integer id) {
        bookDAO.deleteUser(id);
    }

    @Override
    public Integer getCount() {
        Integer count = bookDAO.getCount();
        return count;
    }

    @Override
    public User getUserById(Integer id) {
        return bookDAO.getUserById(id);
    }

    @Override
    public List<User> getUserList() {
        return bookDAO.getUserList();
    }

    @Override
    public void batchAdd(List<Object[]> batchArgs) {
        bookDAO.batchAdd(batchArgs);
    }

    @Override
    public void batchUpdate(List<Object[]> batchArgs) {
        bookDAO.batchUpdate(batchArgs);
    }

    @Override
    public void batchDelete(List<Object[]> batchArgs) {
        bookDAO.batchDelete(batchArgs);
    }
}
   